//
//  KKQuestionnaireItemList.m
//  KKRequestDemo
//
//  Created by Mac mini on 16/1/25.
//  Copyright © 2016年 JuniorCodingPerson. All rights reserved.
//

#import "KKQuestionnairePageItem.h"

@implementation KKQuestionnairePageItem

- (KKQuestionnaireStatus)itemStatus {
    
    KKQuestionnaireStatus status = KKQuestionnaireStatusUnDistribute;
    
    switch ([_kk_oiStatus integerValue]) {
        case -1:
            status = KKQuestionnaireStatusDeleted;
            break;
        case 1:
            status = KKQuestionnaireStatusUnDistribute;
            break;
        case 2:
            status = KKQuestionnaireStatusDistributed;
            break;
        case 3:
            status = KKQuestionnaireStatusDownload;
            break;
        case 4:
            status = KKQuestionnaireStatusUpload;
            break;
        case 5:
            status = KKQuestionnaireStatusReturn;
            break;
            
        default:
            break;
    }
    
    return status;
}

- (void)setKk_SheetQuestionGroup:(NSArray *)kk_SheetQuestionGroup {
    
    NSMutableArray *items = [NSMutableArray array];
    for (NSDictionary *itemDictionary in kk_SheetQuestionGroup) {
        
        KKSheetQuestionGroup *item = [KKSheetQuestionGroup new];
        [item kk_parserJsonDictionary: itemDictionary];
        [items addObject: item];
    }
    _kk_SheetQuestionGroup = [NSMutableArray arrayWithArray: items];
}

@end


@implementation KKSheetQuestionGroup

- (void)setKk_SheetQuestion:(NSArray *)kk_SheetQuestion {

    NSMutableArray *items = [NSMutableArray array];
    for (NSDictionary *itemDictionary in kk_SheetQuestion) {
        
        KKSheetQuestionItem *item = [KKSheetQuestionItem new];
        [item kk_parserJsonDictionary: itemDictionary];
        [items addObject: item];
    }
    _kk_SheetQuestion = [NSMutableArray arrayWithArray: items];
}

@end